import React from "react";
import Layout from "../layout";
import {
  HomeOutlined,
  UnorderedListOutlined,
  FileAddOutlined,
} from "@ant-design/icons";
const Home = React.lazy(() => import("../views/home"));
const ListAdd = React.lazy(() => import("../views/listAdd"));
const ListManage = React.lazy(() => import("../views/listManage"));
const Login = React.lazy(() => import("../views/login"));

export const menusRoutes = [
  {
    path: "/",
    element: <Home></Home>,
    meta: {
      title: "首页",
      icon: <HomeOutlined />,
    },
  },
  {
    path: "/list/add",
    element: <ListAdd></ListAdd>,
    meta: {
      title: "列表添加",
      icon: <FileAddOutlined />,
    },
  },
  {
    path: "/list/manage",
    element: <ListManage></ListManage>,
    meta: {
      title: "列表管理",
      icon: <UnorderedListOutlined />,
    },
  },
];

export const routes = [
  {
    path: "/login",
    element: <Login></Login>,
  },
  {
    path: "/",
    element: <Layout></Layout>,
    children: menusRoutes,
  },
];
